<extend name="Public/base"/>

<block name="body">
  <!-- 标题 -->
  <div class="main-title">
    <h2>添加文章</h2>
  </div>
  <form action="{:U('update')}" method="post" class="form-horizontal">
    <eq name="has_category" value="1">
      <div class="form-item cf">
        <label class="item-label">文章分类</label>
        <div class="controls" id="J_article_category">加载中...</div>
      </div>
    </eq>
    <div class="form-item">
      <label class="item-label">文章标题</label>
      <div class="controls">
        <input type="text" name="title" class="text input-large" value="">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">属性</label>
      <div class="controls">
        <label><input type="checkbox" name="is_topic" value="1"> 头条</label>
        <label><input type="checkbox" name="is_top" value="1"> 置顶</label>
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">文章图片</label>
      <div class="controls">
        {:hook('uploadImages', array('name' => 'images', 'tpl' => 'one'))}
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">文章内容</label>
      <div class="controls">
        <textarea name="content"></textarea>
        {:hook('adminArticleEdit', array('name'=>'content', 'value'=>''))}
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">文章描述</label>
      <div class="controls">
        <textarea name="description" class="textarea input-large" rows="4"></textarea>
      </div>
    </div>
    <div class="form-item">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </div>
  </form>
</block>

<block name="script">
  <script src="__JS__/jquery/jquery.loadtype-2.0.js"></script>
  <script type="text/javascript">
  $(function(){
    /*导航高亮*/
    highlight_subnav('{:U("Article/index")}');
    $('#J_article_category').loadtype({
      type: 'ArticleCategory',
      name: 'cid'
    });
  });
  </script>
</block>
